`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    19:49:25 06/21/2015 
// Design Name: 
// Module Name:    LoadControlUnit 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module LoadControlUnit(
	input [31:0] in,
	output reg [31:0] out,
	input [2:0] ctrl
    );

always @* begin
	if (ctrl == 3'b 000) out = $signed(in[7:0]); //LB
	else if (ctrl == 3'b 100) out = in[7:0]; //LBU
	else if (ctrl == 3'b 001) out = $signed(in[15:0]); //LH
	else if (ctrl == 3'b 101) out = in[15:0]; //LHU
	else if (ctrl == 3'b 111) out = in[31:0]; //LWU
	else out = $signed(in[31:0]); //LW
end

endmodule
